package com.shop.pandian.util;

import java.io.PrintWriter;
import java.io.StringWriter;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * @author Xi Wei
 * @version 1.0
 * @since 1.0
 */
public class Log {
	private static Logger log = LoggerFactory.getLogger(Log.class);

	public static void debug(Object obj) {
		log.debug("$$[QQQ DEBUG] " + obj);
	}

	public static void info(Object obj) {
		log.info("$$[QQQ INFO] " + obj);
	}

	public static void warn(Object obj) {
		log.warn("$$[QQQ WARN] " + obj);
	}

	public static void error(Object obj) {
		log.error("$$[QQQ ERROR] " + obj);
	}

	public static void logExceptionStackTrack(Throwable e) {
		StringWriter sw = new StringWriter();
		PrintWriter p = new PrintWriter(sw);
		e.printStackTrace(p);
		Log.info(sw.toString());
	}
}
